#ifndef XDIVA_ENTRYFRAMEITEM_H
#define XDIVA_ENTRYFRAMEITEM_H

#include "PanelTreeItem.h"

class DiagramScene;
class UnfoldArrayButton;
class WOP_Entry;
class EntryItem;
class AbstractPanel;

class EntryFrameItem :
	public PanelTreeItem
{
public:

	EntryFrameItem( WOP_Entry* , std::vector<xMappingNode*>& , DiagramScene*, AbstractPanel* );
	~EntryFrameItem(void);
	void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *);
	QRectF boundingRect() const;
	void setExpanded(bool);
	bool getExpanded();
	void setupPort();
	void remove();

private:
	DiagramScene* _scene;
	WOP_Entry* _wopEntry;
	std::vector<EntryItem* > _entryNodes;
	bool _isExpanded;
	UnfoldArrayButton* _changeTypeButton;
	void createEntryNodes(std::vector<xMappingNode*>&);
	void unfoldArray(bool);
	void unfold(bool);
	void initName();
};

#endif
